package zuoye_4_14;


public class Print151 extends Thread {
    private final Object lock;

    public Print151(Object lock) {
        this.lock = lock;
    }

    @Override
    public void run() {
        try {
            for (int i = 1; i <= 52; i++) {
                synchronized (lock) {
                    System.out.print(i);
                    if (i % 2 == 0) {
                        lock.notify();
                        if (i < 52) {
                            lock.wait();
                        }
                    }
                }
            }
        } catch (InterruptedException e) {
        	
        }
    }
}